 <%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

 <%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
        <link rel="stylesheet" href="<%=basePath %>/css/list.css">
		<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
		<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
		<script src="<%=basePath %>/js/jquery.min.js"></script>
		<script src="<%=basePath %>/js/formsJS.js"></script>
		
		

<script type="text/javascript">

function checkForm(f){
	
	if(f.userName.value.replace(/\s/g,'') == ''){
		alert("用户昵称不能为空");
		return false;
	}
	
	if(f.telephone.value.replace(/\s/g,'') == ''){
		alert("用户手机不能为空");
		return false;
	}
	if(f.status.value.replace(/\s/g,'') == ''){
		alert("用户状态不能为空");
		return false;
	}
	 
	 if(checkTel() == "false"){
		 alert("您所输入的手机号，系统已经存在，请输入不存在的手机号");
		return false;
	 }
 
	return true;
}
 
//判断输入的手机号是否存在
function checkTel() {
 	var telFlag = "" ;//判断手机号，是否可用
    var telephone = $("#telephone").val();
 	var userId = $("#userId").val();
       $.ajax({
			   type: "GET",
			   async: false ,
			   url: "<%=basePath%>/member/checkMember?telephone="+telephone+"&userId="+userId,
			   success: function(data){
				   telFlag = data ;
			   },
			   
			});
       return telFlag;
} 

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">用户信息维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/member/memberEdit" method="post" onsubmit="return checkForm(this)"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    					<div class="col-sm-4">
	    							<div class="boxs">
												<input type="hidden" name="userId" value="${member.userId}" id="userId"><br />
												<input type="text" class="inputBox" placeholder="用户昵称" name="userName" value="${member.userName}" >
												<input type="text" class="inputBox" placeholder="用户手机" name="telephone" value="${member.telephone}" id="telephone" >
												<input type="text" class="inputBox" placeholder="用户来源" name="userSource" value="${member.userSource}" >
												
												<select id="status" name="status" class="selectBox"  >
												  	<option value="">用户状态</option>
										  			<option value="0" ${member.status == 0 ? 'selected="selected"' : '' }>停用</option>
										  			<option value="1" ${member.status == 1 ? 'selected="selected"' : '' }>启用</option>
												</select>
												<select id="blackFlag" name="blackFlag" class="selectBox"  >
												  	<option value="">是否黑名单</option>
										  			<option value="0" ${member.blackFlag == 0 ? 'selected="selected"' : '' }>否</option>
										  			<option value="1" ${member.blackFlag == 1 ? 'selected="selected"' : '' }>是</option>
												</select>
  												 <br></br>
												<input type="submit" value="确定" class="true" />
												<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
										</div>
								</div>
					</form>
			</div>
	</div>
	
</body>
	 
</html>